{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Title: #Calculate Delayed Arrival Time"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Difficulty: #Easy"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Category Title: #Algorithms"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Tag Slug: #math"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Name Translated: #数学"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Solution Name: findDelayedArrivalTime"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Translated Title: #计算列车到站时间"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Translated Content:\n",
    "<p>给你一个正整数 <code>arrivalTime</code> 表示列车正点到站的时间（单位：小时），另给你一个正整数 <code>delayedTime</code> 表示列车延误的小时数。</p>\n",
    "\n",
    "<p>返回列车实际到站的时间。</p>\n",
    "\n",
    "<p>注意，该问题中的时间采用 24 小时制。</p>\n",
    "\n",
    "<p>&nbsp;</p>\n",
    "\n",
    "<p><strong>示例 1：</strong></p>\n",
    "\n",
    "<pre><strong>输入：</strong>arrivalTime = 15, delayedTime = 5 \n",
    "<strong>输出：</strong>20 \n",
    "<strong>解释：</strong>列车正点到站时间是 15:00 ，延误 5 小时，所以列车实际到站的时间是 15 + 5 = 20（20:00）。\n",
    "</pre>\n",
    "\n",
    "<p><strong>示例 2：</strong></p>\n",
    "\n",
    "<pre><strong>输入：</strong>arrivalTime = 13, delayedTime = 11\n",
    "<strong>输出：</strong>0\n",
    "<strong>解释：</strong>列车正点到站时间是 13:00 ，延误 11 小时，所以列车实际到站的时间是 13 + 11 = 24（在 24 小时制中表示为 00:00 ，所以返回 0）。</pre>\n",
    "\n",
    "<p>&nbsp;</p>\n",
    "\n",
    "<p><strong>提示：</strong></p>\n",
    "\n",
    "<ul>\n",
    "\t<li><code>1 &lt;= arrivaltime &lt;&nbsp;24</code></li>\n",
    "\t<li><code>1 &lt;= delayedTime &lt;= 24</code></li>\n",
    "</ul>\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Description: [calculate-delayed-arrival-time](https://leetcode.cn/problems/calculate-delayed-arrival-time/description/)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Solutions: [calculate-delayed-arrival-time](https://leetcode.cn/problems/calculate-delayed-arrival-time/solutions/)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_cases = ['15\\n5', '13\\n11']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        total = arrivalTime + delayedTime\n",
    "        if(total <24):\n",
    "            return total\n",
    "        else:\n",
    "            return total - 24; "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "            return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return arrivalTime + delayedTime if arrivalTime + delayedTime < 24 else arrivalTime + delayedTime - 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        arrivalTime = (arrivalTime + delayedTime) % 24\n",
    "        return arrivalTime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) %24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        x=arrivalTime+delayedTime\n",
    "        if x>=24:\n",
    "            x=x%24\n",
    "        return x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        arrivalTime = (arrivalTime+delayedTime)%24\n",
    "        if arrivalTime == 24:\n",
    "            return  0\n",
    "        else:\n",
    "            return arrivalTime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        # 计算实际到站时间\n",
    "        actualArrivalTime = (arrivalTime + delayedTime) % 24\n",
    "        return actualArrivalTime\n",
    "\n",
    "# 示例测试\n",
    "solution = Solution()\n",
    "print(solution.findDelayedArrivalTime(15, 5))  # 输出 20\n",
    "print(solution.findDelayedArrivalTime(13, 11))  # 输出 0\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        time=arrivalTime+delayedTime\n",
    "        if time==24:\n",
    "            return 0\n",
    "        elif time>=25:\n",
    "            time = time-24\n",
    "            return time\n",
    "        return time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        if delayedTime + arrivalTime < 24:\n",
    "            return delayedTime + arrivalTime\n",
    "        if delayedTime + arrivalTime >=24:\n",
    "            return delayedTime + arrivalTime - 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        answer = arrivalTime+delayedTime\n",
    "        while answer>= 24:\n",
    "            answer -= 24\n",
    "        return answer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return((arrivalTime + delayedTime) % 24)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime) %24\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "\n",
    "    \treturn (arrivalTime + delayedTime)%24\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        t=arrivalTime+delayedTime\n",
    "        return t if t<24 else t-24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        time=arrivalTime+delayedTime\n",
    "        if time==24:\n",
    "            return 0\n",
    "        elif time>=25:\n",
    "            time = time-24\n",
    "            return time\n",
    "        return time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        #if arrivalTime + delayedTime > 24:\n",
    "       #     return arrivalTime + delayedTime -24\n",
    "    \treturn (arrivalTime + delayedTime)%24\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime) if (arrivalTime+delayedTime)<24 else (arrivalTime+delayedTime-24)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) - 24 if (arrivalTime + delayedTime) >= 24 else arrivalTime + delayedTime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime) % 24\n",
    "      \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        totalTime=arrivalTime+delayedTime\n",
    "        return totalTime%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        out = arrivalTime+delayedTime\n",
    "        if out >= 24:\n",
    "            return out-24\n",
    "        return out\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        if arrivalTime+delayedTime==24:\n",
    "            return 0\n",
    "        elif arrivalTime+delayedTime<24:\n",
    "            return arrivalTime+delayedTime\n",
    "        else:\n",
    "             return abs(24-(arrivalTime+delayedTime))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24\n",
    "      \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) - 24 if (arrivalTime + delayedTime) >= 24 else arrivalTime + delayedTime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime) %24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        if arrivalTime + delayedTime >= 24:\n",
    "            return arrivalTime + delayedTime - 24\n",
    "        else:\n",
    "            return arrivalTime + delayedTime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime) % 24\n",
    "      \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        truearrivalTime=(arrivalTime+delayedTime)%24\n",
    "        if truearrivalTime==24:\n",
    "            truearrivalTime=0\n",
    "        return truearrivalTime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        ans=arrivalTime+delayedTime\n",
    "        if 0<=ans<=23: return ans\n",
    "        else: return ans-24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        result = arrivalTime + delayedTime\n",
    "        return result if result < 24 else result%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        if arrivalTime + delayedTime >= 24:\n",
    "            return arrivalTime + delayedTime - 24\n",
    "        else:\n",
    "            return arrivalTime + delayedTime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        t = arrivalTime + delayedTime\n",
    "        if t < 24:\n",
    "            return t\n",
    "        else:\n",
    "            return t - 24    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) % 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        a=arrivalTime+delayedTime\n",
    "        if a>=24:\n",
    "            a-=24\n",
    "        return a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime+delayedTime)%24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def findDelayedArrivalTime(self, arrivalTime: int, delayedTime: int) -> int:\n",
    "        return (arrivalTime + delayedTime) %  24"
   ]
  }
 ],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 2
}
